/** \file    refine/smooth_poisson.h
  * \brief   Construct smooth grey mask from existing bit mask solving Poisson equation.
  * \date    2005
  * \author  Fedor Chelnokov
  * \version $Header: /home/cscom1r4/cvsroot/cs/include/refine/smooth_poisson.h,v 1.1 2005/06/24 20:03:40 cscom1r4 Exp $
  */

#ifndef _refine_smooth_poisson_h_
#define _refine_smooth_poisson_h_

#include "types.h"

namespace refine {

namespace smooth_poisson {

struct params {
	int window_half_size;
	float adaptability; ///< [0,1+]; if the value is zero then source image is ignored, if the value is 1 it has big impact
	bool has_initial_apprx; ///< some grey mask is provided and it must be only modified
	bool silent;
};

extern params const default_params;

void perform(const byte_image & src, const bit_mask::mask & m, grey_mask::mask & s, const params & p = default_params);
void perform(const argb_byte_image & src, const bit_mask::mask & m, grey_mask::mask & s, const params & p = default_params);

///(r,g,b) channels are source images that will be unchanged,
///alpha channel will receive smooth mask
void perform(byte_image & img, const bit_mask::mask & m, const params & p = default_params);
void perform(argb_byte_image & img, const bit_mask::mask & m, const params & p = default_params);

} //namespace smooth_poisson

} //namespace refine

#endif //_refine_smooth_poisson_h_
